#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 1e5 + 10;
const int B = 250;

int bel[N], n, c, m, a[N], ans[N / B + 10][N / B + 10], cnt[N / B + 10][N], tcnt[N], tim, xl[N / B + 10], xr[N / B + 10], vis[N];

int getcnt(int x) { if(vis[x] != tim) vis[x] = tim, tcnt[x] = 0; return tcnt[x]; }
void modicnt(int x) { if(vis[x] != tim) vis[x] = tim, tcnt[x] = 0; tcnt[x]++; }
void reset() { ++tim; }

int query(int l, int r) {
	int bl = bel[l], br = bel[r];
	if(bl == br) {
		reset(); int res = 0;
		rep(i, l, r) res -= getcnt(a[i]) > 0 && (getcnt(a[i]) % 2 == 0), modicnt(a[i]), res += getcnt(a[i]) % 2 == 0;
		return res;
	}
	reset();
	int res = ans[bl + 1][br - 1];
	auto gcnt = [&](int x) { return getcnt(x) + cnt[br - 1][x] - cnt[bl][x]; };
	rep(i, l, xr[bl]) res -= (gcnt(a[i]) > 0 && gcnt(a[i]) % 2 == 0), modicnt(a[i]), res += (gcnt(a[i]) > 0 && gcnt(a[i]) % 2 == 0);
	rep(i, xl[br], r) res -= (gcnt(a[i]) > 0 && gcnt(a[i]) % 2 == 0), modicnt(a[i]), res += (gcnt(a[i]) > 0 && gcnt(a[i]) % 2 == 0);
	return res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in", "r", stdin);
#endif
	n = in, c = in, m = in;
	rep(i, 1, n) a[i] = in, bel[i] = (i - 1) / B + 1, xr[bel[i]] = i;
	rep(i, 1, bel[n]) xl[i] = xr[i - 1] + 1;
	reset();
	rep(i, 1, n) {
		modicnt(a[i]);
		if(i == xr[bel[i]]) {
			rep(j, 0, c) cnt[bel[i]][j] = getcnt(j);
		}
	}
	rep(i, 1, bel[n]) {
		reset(); int res = 0;
		rep(j, xl[i], n) {
			res -= getcnt(a[j]) > 0 && getcnt(a[j]) % 2 == 0; modicnt(a[j]); res += getcnt(a[j]) % 2 == 0;
			if(j == xr[bel[j]]) ans[i][bel[j]] = res;
		}
	}
	int ans = 0;
	while(m--) {
		int l = (in + ans) % n + 1, r = (in + ans) % n + 1;
		if(l > r) swap(l, r); printf("%d\n", ans = query(l, r));
	}
	return 0;
}
